package com.example.doctorstation.POJOMapper;
import com.example.doctorstation.POJOData.Bed;
import java.util.List;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.StatementType;

@Mapper
public interface BedMapper {
    //筛选某个病区的所有病床
    @Select("call GetDepartmentPatients(#{arg0})")
    List<Bed> getBed(String departmentName);

    //查询医生还没分配床位的病人
    @Select("call GetFreePatientsBydoctorid(#{arg0})")
    public List<Bed> getFreePatients(Integer doctorid);



   //更新床位
    @Select("call UpdateBed(#{arg0},#{arg1},#{arg2},#{arg3, mode=OUT, jdbcType=INTEGER})")
   @Options(statementType = StatementType.CALLABLE)
   public void UpdateBedInfo(String bedseq,String departmentName,Integer inHospitalInfoID,Integer res);

    //更新床位
    @Select("call UpdateBedNotOut(#{arg0},#{arg1},#{arg2})")
    public int UpdateBedInfoNotOut(String bedseq,String departmentName,Integer inHospitalInfoID);

    //查看床位信息
    @Select("call SelectBed(#{arg0},#{arg1})")
    public Bed SelectBedInfo(String bedseq,String departmentName);
}
